/****************************************************
	文件：GoapPreOrEff.cs
	作者：林文豪
	日期：2021/05/09 10:51:03
	功能：1、Goap系统的条件容器，相等的判断是键的字符串相等，并且值的字符串相等
*****************************************************/
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace MyGame.AI.GOAP {
	public class GoapConditionContainer : IEquatable<GoapConditionContainer> {
		public readonly string Key;
		public readonly object Value;
		
		public GoapConditionContainer(string key,object value) {
			Key   = key;
			Value = value;
		}

		public bool Equals(GoapConditionContainer other) {
			if (other == null)
				return false;
			
			if (Key.Equals(other.Key) && Value.ToString().Equals(other.Value.ToString()))
				return true;
			
			return false;
		}
	}
}

